package com.neusoft.eenie.signdemo.utile;

import com.neusoft.eenie.signdemo.bean.FlagInfo;
import com.orhanobut.logger.Logger;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

/**
 * Created by Eenie on 2016/3/25.
 */
public class HtmlTools {
    public static FlagInfo parseHtmlTitle(String str) {
        FlagInfo flag = new FlagInfo();
        Document document = Jsoup.parse(str);
        Elements elements = document.getElementsByTag("title");
        flag.setFlag(elements.text());

        Elements ele = document.getElementsByClass("list-group-item");
        String con = ele.get(0).attr("href");
        flag.setMid(con.substring(con.lastIndexOf("/") + 1));
        flag.setManaName(String.valueOf(document.getElementsByTag("div").get(2).text()));
        return flag;
    }



}
